package com.kitty.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.Tag;

public class MyTag extends BodyTagSupport {

	private static final long serialVersionUID = 437498774140080000L;

	private String name;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public int doEndTag() throws JspException {
		
		JspWriter out = super.pageContext.getOut();
		
		try {
			out.println("page content..." + this.getBodyContent().getString());
			out.println("测试字符串!" + this.getName() + ";;;" + super.getParent());
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return Tag.EVAL_PAGE;
	}
	
}
